package com.shensi.api.admin.client.fleet;

import com.shensi.api.admin.client.fallback.fleet.FleetCardSubClientFallBack;
import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.device.dto.FleetCardSubForm;
import com.shensi.api.admin.domian.device.dto.FleetCardSubQueryForm;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;
import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = FleetCardSubClientFallBack.class)
@Component
public interface FleetCardSubClient {

    @GetMapping("/fleetCard/sub/page")
    public TableDataInfo page(@SpringQueryMap FleetCardSubQueryForm fleetCardSubQueryForm);

    @PutMapping("/fleetCard/sub/{id}")
    public AjaxResult edit(@PathVariable("id") Long id, @RequestBody FleetCardSubForm fleetCardSubForm) ;

    @PutMapping("/fleetCard/sub/allocationAmount/{allocationAmount}/id/{id}")
    public AjaxResult allocationAmount(@PathVariable("allocationAmount") BigDecimal allocationAmount, @PathVariable("id") Long id);

    @PutMapping("/fleetCard/sub/recovery/{id}")
    public AjaxResult recovery(@PathVariable("id") Long id);

    @PutMapping("/fleetCard/sub/review/{id}/status/{status}")
    public AjaxResult review(@PathVariable("id") Long id, @PathVariable("status") Integer status);

    @DeleteMapping("/fleetCard/sub/{ids}")
    public AjaxResult deleted(@PathVariable("ids") List<Long> ids);

}
